package Java4_10;

import java.util.Scanner;

public class Java_2text {
	public static void main(String[] args) {

		Java2 s1 = new Java2("科海", "合肥", 1234567, "软件开发");
		s1.show1();
		s1.in();

		while (true) {
			System.out.println("1:招聘员工2:输出员工信息 3:辞退员工 4:统计员工 5:加薪 0:退出");
			Scanner n = new Scanner(System.in);
			int a = n.nextInt();
			switch (a) {
			case 1:
				System.out.println("请输入工号");
				int go = n.nextInt();
				if (s1.s.contains(new Java_2(go))) {
					System.out.println("有重复 请输入别的数字");
					break;
				}
				System.out.println("输入姓名");
				String name = n.next();
				System.out.println("输入年龄");
				int age = n.nextInt();
				System.out.println("请输入性别");
				String exe = n.next();
				System.out.println("请输入职位");
				String zhi = n.next();
				System.out.println("请输入薪水");
				int xin = n.nextInt();
				if (s1.add(name, age, exe, zhi, xin, go)) {
					System.out.println("添加成功");
				} else {
					System.out.println("添加失败");
				}

				break;
			case 2:
				s1.show();
				break;
			case 3:
				System.out.println("请输入工号");
				int ff = n.nextInt();
				if (s1.is(ff)) {
					System.out.println("成功");
				} else {
					System.out.println("失败");
				}
				break;
			case 4:
				System.out.println(s1.sum());
				break;
			case 5:
				s1.find(s1);
				break;
			case 0:
				return;
			default:
				System.out.println("错误");
				break;
			}
		}
	}
}
